package com.xmy.cultivate.mapper;

import com.xmy.cultivate.entity.StudentAccount;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author hpiggy
 * @since 2023-07-15
 */
public interface StudentAccountMapper extends BaseMapper<StudentAccount> {

    @Select("select * from student_account where student_id = ${studentId} and deleted = 0 limit 1")
    public StudentAccount getOneForStudentId(@Param("studentId") Long studentId);

    @Select("SELECT account FROM student_account WHERE student_id = #{studentId}")
    String getAccountByStudentId(@Param("studentId") Long studentId);
}
